You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Perhaps we should also check for "ContentType": "application/x-directory; charset=UTF-8", as a precaution? This would prevent the special key from filtering out in case the user has actually set it.
I don't have access to AWS S3 right now (I can set it up later), so I am testing it with Cloudflare R2. I also artificially created an empty object at s3://anam-data-dev/rofl/ via s3fs I've also created another empty object at s3://anam-data-dev/rofl/object .
I've encountered a different issue now:
/tmp/rofl via 🐍 v3.12.7 (rofl) via on 🅰 (auto)
› uv pip install git+https://github.com/ap--/universal_pathlib.git@dont-list-directorymarkers-in-iterdir
Resolved 3 packages in 540ms
Uninstalled 1 package in 2ms
░░░░░░░░░░░░░░░░░░░░ [0/1] Installing wheels...
Installed 1 package in 6ms
- universal-pathlib==0.3.8
+ universal-pathlib==0.0.12.post330+gb5d91d25e (from git+https://github.com/ap--/universal_pathlib.git@b5d91d25e2f7acb0e533617a1e38184d375944d9)
/tmp/rofl via 🐍 v3.12.7 (rofl) via on 🅰 (auto)
› ipython
Python 3.12.7 (main, Oct 16 2024, 04:37:19) [Clang 18.1.8 ]
Type 'copyright', 'credits' or 'license' for more information
IPython 9.9.0 -- An enhanced Interactive Python. Type '?' for help.
Tip: You can find how to type a LaTeX symbol by back-completing it, eg `\θ<tab>` will expand to `\theta`.
In [1]: from upath import UPath
In [2]: path = UPath("s3://anam-data-dev/")
In [3]: list(path.iterdir())
Out[3]:
[S3Path('anam-data-dev/rofl', protocol='s3'),
S3Path('anam-data-dev/rofl', protocol='s3'),
S3Path('anam-data-dev/test', protocol='s3'),
S3Path('anam-data-dev/test.delta', protocol='s3'),
S3Path('anam-data-dev/video-factory', protocol='s3'),
S3Path('anam-data-dev/video-generation', protocol='s3')]
In [4]: path = UPath("s3://anam-data-dev/rofl")
In [5]: list(path.iterdir())
---------------------------------------------------------------------------
NotADirectoryError Traceback (most recent call last)
Cell In[5], line 1
----> 1 list(path.iterdir())
File /tmp/rofl/.venv/lib/python3.12/site-packages/upath/core.py:1192, in UPath.iterdir(self)
1190 base_path = base.path
1191 if not fs.isdir(base_path):
-> 1192 raise NotADirectoryError(str(self))
1193 name: str
1194 for info in fs.listdir(base_path):
1195 # fsspec returns dictionaries
NotADirectoryError: s3://anam-data-dev/rofl
In [6]: path = UPath("s3://anam-data-dev/rofl/")
In [7]: list(path.iterdir())
---------------------------------------------------------------------------
NotADirectoryError Traceback (most recent call last)
Cell In[7], line 1
----> 1 list(path.iterdir())
File /tmp/rofl/.venv/lib/python3.12/site-packages/upath/core.py:1192, in UPath.iterdir(self)
1190 base_path = base.path
1191 if not fs.isdir(base_path):
-> 1192 raise NotADirectoryError(str(self))
1193 name: str
1194 for info in fs.listdir(base_path):
1195 # fsspec returns dictionaries
NotADirectoryError: s3://anam-data-dev/rofl
So the artificial marker object breaks universal-pathlib right now (for me) when trying to list the marker path. It looks like the requirement here is to have both s3://anam-data-dev/rofl/ and s3://anam-data-dev/rofl/object empty.
I don't have access to AWS S3 right now (I can set it up later), so I am testing it with Cloudflare R2. I also artificially created an empty object at s3://anam-data-dev/rofl/ via s3fs I've also created another empty object at s3://anam-data-dev/rofl/object
s3fs doesn't let you do this like the aws console would because it strips the trailing slash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Should close #226